<!DOCTYPE html>
<html>
<#if root?exists>
<head>
<title>WebDesign Admin - Home</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- bootstrap -->
<link href="${root.path}/css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="${root.path}/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
<link href="${root.path}/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

<!-- libraries -->
<link href="${root.path}/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

<!-- global styles -->
<link rel="stylesheet" type="text/css" href="${root.path}/css/layout.css" />
<link rel="stylesheet" type="text/css" href="${root.path}/css/elements.css" />
<link rel="stylesheet" type="text/css" href="${root.path}/css/icons.css" />

<!-- this page specific styles -->
<link rel="stylesheet" href="${root.path}/css/compiled/tables.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${root.path}/css/compiled/index.css" type="text/css" media="screen" />

<!-- open sans font -->
<link
	href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'
	rel='stylesheet' type='text/css' />

<!-- lato font -->
<link
	href='http://fonts.useso.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic'
	rel='stylesheet' type='text/css' />

<link rel="stylesheet" href="${root.path}/css/font-awesome.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
	<!-- navbar -->
	<div class="navbar navbar-inverse">
		<div class="navbar-inner">
			<a class="brand" href="#">
				<img src="${root.path}/img/logo-login.png" />
			</a>
			<ul class="nav pull-right">
				<!--无序列表-->
				 <li>
                	<a href="${root.path}/admin/showTeachers">
                   	${root.username}
                	</a>
            	</li>
				<div class="copyrights"></div>

				<li class="hidden-phone">
                    <a href="#">修改密码</a>
                </li>

                <li class="hidden-phone">
                    <a href="${root.path}/common/logout">注销</a>
                </li>
			</ul>
		</div>
	</div>
	<!-- end navbar -->

	<!-- sidebar -->
	<div id="sidebar-nav">
		<ul id="dashboard-menu">
			<li>
				<a href="${root.path}/admin/showTeachers"> 
					<i class="icon-home"></i>
					<span>管理员主页</span>
				</a>
			</li>

			<li>
				<a class="dropdown-toggle" href="#"> 
					<i class="icon-asterisk"></i>
					<span>教师管理</span>
					<i class="icon-chevron-down"></i>
				</a>
				<ul class="submenu">
					<li><a href="${root.path}/admin/resetTeachersPwdShow">重置密码</a></li>
				</ul>
			</li>

			<li class="active">
				<div class="pointer">
					<div class="arrow"></div>
					<div class="arrow_border"></div>
				</div> 
				<a class="dropdown-toggle" href="#"> 
					<i class="icon-edit"></i>
			 		<span>门户信息设置</span>
			 		<i class="icon-chevron-down"></i>
				</a>
				<ul class="submenu">
					<li><a href="${root.path}/admin/setBasicInfo">基本信息设置</a></li>
					<li><a href="${root.path}/admin/setDisplyShow">轮播展示</a></li>
				</ul>
				</a>
			</li>

			<li>
				<a href="${root.path}/admin/showAllHomeworks">
				 	<i class="icon-list-alt "></i>
					<span>作业信息</span>
				</a>
			</li>

	</div>
	<!-- end sidebar -->
	
<!-- main container -->
<div class="content">
    <div class="container-fluid">
        <div id="pad-wrapper">
            <!-- products table-->
            <!-- the script for the toggle all checkboxes from header is located in js/theme.js -->
            <div class="table-wrapper products-table table-products section"><!--table-wrapper在tables.css-->
                <div class="row-fluid filter-block">
                  
                </div>
                <div class="row-fluid">
                	<form action="${root.path}/teacher/redirectDisplay" id="display" method="post">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th class="span3">
                             	<span class="line"></span>学号
                            </th>
                            <th class="span3">
                                <span class="line"></span>姓名
                            </th>
                            <th class="span3">
                                <span class="line"></span>查看
                            </th>
                            <th class="span3">
                                <span class="line"></span>分数
                            </th>
                        </tr>
                        </thead>
                        <tbody>
	                        <!-- row -->
	                        <#list root.homeworklist as work>
	                        <tr>
	                            <td>${work.userid}</td>
	                            <td>${work.username}</td>
	                            <td>
	                                <a href="${work.address}">
	                                	<span class="label label-success">查看</span>
	                                </a>
	                            </td>
	                            <td>
	                           		<input type="text" name="score" value=${work.score} readonly style="width:30px;margin-top: 11px;"/>
	                            </td>
	                        </tr>
	                        </#list>
                        </tbody>
                    </table>
                   </form>
                </div>
            </div>
            <!-- end products table -->
             <!-- end products table -->
            <form action="#" method="post" name="form1" id="form1">
            		<!-- 分页 -->
					<div class="table-products pagination">
      					<font class="title">共</font>
      						${root.page.totalPages}<font class="title">页　当前第 </font> 
     						${root.page.number}<font class="title">页</font>
     					<input type="hidden" id="number" value="${root.page.number}"/>  
      					<input type="button" class="btn-flat white" id="sy"  onclick="selectSy(${root.page.number},${root.page.totalPages})" value="首页"/>  
      					<input type="button" class="btn-flat white" id="syy" onclick="selectSyy(${root.page.number},${root.page.totalPages})" value="上一页 "/>  
      					<input type="button" class="btn-flat white" id="xyy" onclick="selectXyy(${root.page.number},${root.page.totalPages})" value="下一页"/>  
      					<input type="button" class="btn-flat white" id="wy"  onclick="selectWy(${root.page.number},${root.page.totalPages})" value="尾页 "/>  
      				</div>
            </form>
        </div>
    </div>
</div>
<!-- end main container -->

<!-- scripts -->
<script src="${root.path}/js/jquery-latest.js"></script>
<script src="${root.path}/js/bootstrap.min.js"></script>
<script src="${root.path}/js/theme.js"></script>
<script type="text/javascript">
         
		//分页，应该传递pageCount
		 function selectSy(page,pageCount){  
             var page = page;  
             var pageCount = pageCount;  
             if(pageCount==0){  
                 alert("当前无数据");  
             }else if(page==1){     
                 alert("当前已是第一页");  
             } else {
             	 $("#number").val(1);
             	 var number = document.getElementById('number');
             	 var numpage = number.value;
                 form1.action = "${root.path}/teacher/showUnfinishHomework?homeworkid=${root.homeworkid}&numpage="+numpage;  
                 form1.submit();  
             }
         }  
         function selectSyy(page,pageCount){  
             var page = page;  
             var pageCount = pageCount;  
             if(pageCount==0){  
                 alert("当前无数据");  
             }else if(page==1){     
                 alert("当前已是第一页");  
             } else{  
                 $("#number").val(page-1);
                 var number = document.getElementById('number');
             	 var numpage = number.value;
                 form1.action = "${root.path}/teacher/showUnfinishHomework?homeworkid=${root.homeworkid}&numpage="+numpage; 
                 form1.submit();  
             } 
         }  
         function selectXyy(page,pageCount){  
             var page = page;  
             var pageCount = pageCount;  
             if(pageCount==0){  
                 alert("当前无数据");  
             }else if(page==pageCount){  
                 alert("当前已是最后一页");  
             }else{  
                 $("#number").val(page+1);
                 var number = document.getElementById('number');
             	 var numpage = number.value;
                 form1.action = "${root.path}/teacher/showUnfinishHomework?homeworkid=${root.homeworkid}&numpage="+numpage;
                 form1.submit(); 
             }
         }  
         function selectWy(page,pageCount){  
             var page = page;  
             var pageCount = pageCount;  
             if(pageCount==0){  
                 alert("当前无数据");  
             }else if(page==pageCount){  
                 alert("当前已是最后一页");  
             }else{ 
             	 $("#number").val(pageCount);
                 var number = document.getElementById('number');
             	 var numpage = number.value;
                 form1.action = "${root.path}/teacher/showUnfinishHomework?homeworkid=${root.homeworkid}&numpage="+numpage;  
                 form1.submit();  
             }
         }
</script>
</body>
</#if>
</html>